home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Tool Chest / Development Tools & Languages / Macintosh Common Lisp Related / interfaces / Script.lisp < prev    next >
Encoding:
Text File  |  1993-09-16  |  47.6 KB  |  1,077 lines  |  [TEXT/CCL2]

  1.  
  2. (in-package :TRAPS)             ; 
  3. ;     File:        Script.p
  4. ;     Copyright:    © 1983-1993 by Apple Computer, Inc.
  5. ;                 All rights reserved.
  6. ;     Version:    System 7.1 for ETO #11
  7. ;     Created:    Tuesday, March 30, 1993 18:00
  8.  
  9. ; $IFC UNDEFINED UsingIncludes
  10. ; $SETC UsingIncludes := 0
  11. ; $ENDC
  12.  
  13. ; $IFC NOT UsingIncludes
  14.  
  15. ; $ENDC
  16.  
  17. ; $IFC UNDEFINED UsingScript
  18. ; $SETC UsingScript := 1
  19.  
  20. ; $I+
  21. ; $SETC ScriptIncludes := UsingIncludes
  22. ; $SETC UsingIncludes := 1
  23. ; $IFC UNDEFINED UsingTypes
  24.  
  25. (require-interface 'TYPES)      ; $I $$Shell(PInterfaces)Types.p
  26. ; $ENDC
  27. ; $IFC UNDEFINED UsingQuickdraw
  28.  
  29. (require-interface 'QUICKDRAW)  ; $I $$Shell(PInterfaces)Quickdraw.p
  30. ; $ENDC
  31. ; $IFC UNDEFINED UsingIntlResources
  32.  
  33. (require-interface 'INTLRESOURCES); $I $$Shell(PInterfaces)IntlResources.p
  34. ; $ENDC
  35. ; $SETC UsingIncludes := ScriptIncludes
  36.  
  37. ;  Script System constants 
  38.  
  39. (defconstant $smSystemScript -1); designates system script.
  40. (defconstant $smCurrentScript -2); designates current font script.
  41. (defconstant $smAllScripts -3)  ; designates any script
  42.  
  43. (defconstant $smRoman 0)        ; Roman
  44. (defconstant $smJapanese 1)     ; Japanese
  45. (defconstant $smTradChinese 2)  ; Traditional Chinese
  46. (defconstant $smKorean 3)       ; Korean
  47. (defconstant $smArabic 4)       ; Arabic
  48. (defconstant $smHebrew 5)       ; Hebrew
  49. (defconstant $smGreek 6)        ; Greek
  50. (defconstant $smCyrillic 7)     ; Cyrillic
  51. (defconstant $smRSymbol 8)      ; Right-left symbol
  52. (defconstant $smDevanagari 9)   ; Devanagari
  53. (defconstant $smGurmukhi 10)    ; Gurmukhi
  54. (defconstant $smGujarati 11)    ; Gujarati
  55. (defconstant $smOriya 12)       ; Oriya
  56. (defconstant $smBengali 13)     ; Bengali
  57. (defconstant $smTamil 14)       ; Tamil
  58. (defconstant $smTelugu 15)      ; Telugu
  59. (defconstant $smKannada 16)     ; Kannada/Kanarese
  60. (defconstant $smMalayalam 17)   ; Malayalam
  61. (defconstant $smSinhalese 18)   ; Sinhalese
  62. (defconstant $smBurmese 19)     ; Burmese
  63. (defconstant $smKhmer 20)       ; Khmer/Cambodian
  64. (defconstant $smThai 21)        ; Thai
  65. (defconstant $smLaotian 22)     ; Laotian
  66. (defconstant $smGeorgian 23)    ; Georgian
  67. (defconstant $smArmenian 24)    ; Armenian
  68. (defconstant $smSimpChinese 25) ; Simplified Chinese
  69. (defconstant $smTibetan 26)     ; Tibetan
  70. (defconstant $smMongolian 27)   ; Mongolian
  71. (defconstant $smGeez 28)        ; Geez/Ethiopic
  72. (defconstant $smEthiopic 28)    ; Synonym for smGeez
  73. (defconstant $smEastEurRoman 29); Synonym for smSlavic
  74. (defconstant $smVietnamese 30)  ; Vietnamese
  75. (defconstant $smExtArabic 31)   ; extended Arabic
  76. (defconstant $smUninterp 32)    ; uninterpreted symbols, e.g. palette symbols
  77. (defconstant $smKlingon 32)     ; Klingon
  78.  
  79. ; Obsolete names for script systems (kept for backward compatibility)
  80.  
  81. (defconstant $smChinese 2)      ; (use smTradChinese or smSimpChinese)
  82. (defconstant $smRussian 7)      ; (old name for smCyrillic)
  83.  
  84. ;  smMaldivian = 25;         (no more smMaldivian!)
  85.  
  86. (defconstant $smAmharic 28)     ; (old name for smGeez)
  87. (defconstant $smSlavic 29)      ; (old name for smEastEurRoman)
  88. (defconstant $smSindhi 31)      ; (old name for smExtArabic)
  89.  
  90. ;  Language Codes 
  91.  
  92. (defconstant $langEnglish 0)    ;  smRoman script 
  93. (defconstant $langFrench 1)     ;  smRoman script 
  94. (defconstant $langGerman 2)     ;  smRoman script 
  95. (defconstant $langItalian 3)    ;  smRoman script 
  96. (defconstant $langDutch 4)      ;  smRoman script 
  97. (defconstant $langSwedish 5)    ;  smRoman script 
  98. (defconstant $langSpanish 6)    ;  smRoman script 
  99. (defconstant $langDanish 7)     ;  smRoman script 
  100. (defconstant $langPortuguese 8) ;  smRoman script 
  101. (defconstant $langNorwegian 9)  ;  smRoman script 
  102. (defconstant $langHebrew 10)    ;  smHebrew script 
  103. (defconstant $langJapanese 11)  ;  smJapanese script 
  104. (defconstant $langArabic 12)    ;  smArabic script 
  105. (defconstant $langFinnish 13)   ;  smRoman script 
  106. (defconstant $langGreek 14)     ;  smGreek script 
  107. (defconstant $langIcelandic 15) ;  extended Roman script 
  108. (defconstant $langMaltese 16)   ;  extended Roman script 
  109. (defconstant $langTurkish 17)   ;  extended Roman script 
  110. (defconstant $langCroatian 18)  ;  Serbo-Croatian in extended Roman script 
  111. (defconstant $langTradChinese 19);  Chinese in traditional characters 
  112. (defconstant $langUrdu 20)      ;  smArabic script 
  113. (defconstant $langHindi 21)     ;  smDevanagari script 
  114. (defconstant $langThai 22)      ;  smThai script 
  115. (defconstant $langKorean 23)    ;  smKorean script 
  116. (defconstant $langLithuanian 24);  smEastEurRoman script 
  117. (defconstant $langPolish 25)    ;  smEastEurRoman script 
  118. (defconstant $langHungarian 26) ;  smEastEurRoman script 
  119. (defconstant $langEstonian 27)  ;  smEastEurRoman script 
  120. (defconstant $langLettish 28)   ;  smEastEurRoman script 
  121. (defconstant $langLatvian 28)   ;  Synonym for langLettish 
  122. (defconstant $langLapponian 29) ;  extended Roman script 
  123. (defconstant $langLappish 29)   ;  Synonym for langLapponian 
  124. (defconstant $langFaeroese 30)  ;  smRoman script 
  125. (defconstant $langFarsi 31)     ;  smArabic script 
  126. (defconstant $langPersian 31)   ;  Synonym for langFarsi 
  127. (defconstant $langRussian 32)   ;  smCyrillic script 
  128. (defconstant $langSimpChinese 33);  Chinese in simplified characters 
  129. (defconstant $langFlemish 34)   ;  smRoman script 
  130. (defconstant $langIrish 35)     ;  smRoman script 
  131. (defconstant $langAlbanian 36)  ;  smRoman script 
  132. (defconstant $langRomanian 37)  ;  smEastEurRoman script 
  133. (defconstant $langCzech 38)     ;  smEastEurRoman script 
  134. (defconstant $langSlovak 39)    ;  smEastEurRoman script 
  135. (defconstant $langSlovenian 40) ;  smEastEurRoman script 
  136. (defconstant $langYiddish 41)   ;  smHebrew script 
  137. (defconstant $langSerbian 42)   ;  Serbo-Croatian in smCyrillic script 
  138. (defconstant $langMacedonian 43);  smCyrillic script 
  139. (defconstant $langBulgarian 44) ;  smCyrillic script 
  140. (defconstant $langUkrainian 45) ;  smCyrillic script 
  141. (defconstant $langByelorussian 46);  smCyrillic script 
  142. (defconstant $langUzbek 47)     ;  smCyrillic script 
  143. (defconstant $langKazakh 48)    ;  smCyrillic script 
  144. (defconstant $langAzerbaijani 49);  Azerbaijani in smCyrillic script (USSR) 
  145. (defconstant $langAzerbaijanAr 50);  Azerbaijani in smArabic script (Iran) 
  146. (defconstant $langArmenian 51)  ;  smArmenian script 
  147. (defconstant $langGeorgian 52)  ;  smGeorgian script 
  148. (defconstant $langMoldavian 53) ;  smCyrillic script 
  149. (defconstant $langKirghiz 54)   ;  smCyrillic script 
  150. (defconstant $langTajiki 55)    ;  smCyrillic script 
  151. (defconstant $langTurkmen 56)   ;  smCyrillic script 
  152. (defconstant $langMongolian 57) ;  Mongolian in smMongolian script 
  153. (defconstant $langMongolianCyr 58);  Mongolian in smCyrillic script 
  154. (defconstant $langPashto 59)    ;  smArabic script 
  155. (defconstant $langKurdish 60)   ;  smArabic script 
  156. (defconstant $langKashmiri 61)  ;  smArabic script 
  157. (defconstant $langSindhi 62)    ;  smExtArabic script 
  158. (defconstant $langTibetan 63)   ;  smTibetan script 
  159. (defconstant $langNepali 64)    ;  smDevanagari script 
  160. (defconstant $langSanskrit 65)  ;  smDevanagari script 
  161. (defconstant $langMarathi 66)   ;  smDevanagari script 
  162. (defconstant $langBengali 67)   ;  smBengali script 
  163. (defconstant $langAssamese 68)  ;  smBengali script 
  164. (defconstant $langGujarati 69)  ;  smGujarati script 
  165. (defconstant $langPunjabi 70)   ;  smGurmukhi script 
  166. (defconstant $langOriya 71)     ;  smOriya script 
  167. (defconstant $langMalayalam 72) ;  smMalayalam script 
  168. (defconstant $langKannada 73)   ;  smKannada script 
  169. (defconstant $langTamil 74)     ;  smTamil script 
  170. (defconstant $langTelugu 75)    ;  smTelugu script 
  171. (defconstant $langSinhalese 76) ;  smSinhalese script 
  172. (defconstant $langBurmese 77)   ;  smBurmese script 
  173. (defconstant $langKhmer 78)     ;  smKhmer script 
  174. (defconstant $langLao 79)       ;  smLaotian script 
  175. (defconstant $langVietnamese 80);  smVietnamese script 
  176. (defconstant $langIndonesian 81);  smRoman script 
  177. (defconstant $langTagalog 82)   ;  smRoman script 
  178. (defconstant $langMalayRoman 83);  Malay in smRoman script 
  179. (defconstant $langMalayArabic 84);  Malay in smArabic script 
  180. (defconstant $langAmharic 85)   ;  smEthiopic script 
  181. (defconstant $langTigrinya 86)  ;  smEthiopic script 
  182. (defconstant $langGalla 87)     ;  smEthiopic script 
  183. (defconstant $langOromo 87)     ;  Synonym for langGalla 
  184. (defconstant $langSomali 88)    ;  smRoman script 
  185. (defconstant $langSwahili 89)   ;  smRoman script 
  186. (defconstant $langRuanda 90)    ;  smRoman script 
  187. (defconstant $langRundi 91)     ;  smRoman script 
  188. (defconstant $langChewa 92)     ;  smRoman script 
  189. (defconstant $langMalagasy 93)  ;  smRoman script 
  190. (defconstant $langEsperanto 94) ;  extended Roman script 
  191. (defconstant $langWelsh 128)    ;  smRoman script 
  192. (defconstant $langBasque 129)   ;  smRoman script 
  193. (defconstant $langCatalan 130)  ;  smRoman script 
  194. (defconstant $langLatin 131)    ;  smRoman script 
  195. (defconstant $langQuechua 132)  ;  smRoman script 
  196. (defconstant $langGuarani 133)  ;  smRoman script 
  197. (defconstant $langAymara 134)   ;  smRoman script 
  198. (defconstant $langTatar 135)    ;  smCyrillic script 
  199. (defconstant $langUighur 136)   ;  smArabic script 
  200. (defconstant $langDzongkha 137) ;  (lang of Bhutan) smTibetan script 
  201. (defconstant $langJavaneseRom 138);  Javanese in smRoman script 
  202. (defconstant $langSundaneseRom 139);  Sundanese in smRoman script 
  203.  
  204. ;  Obsolete names, kept for backward compatibility 
  205.  
  206. (defconstant $langPortugese 8)  ;  old misspelled version, kept for compatibility 
  207. (defconstant $langMalta 16)     ;  old misspelled version, kept for compatibility 
  208. (defconstant $langYugoslavian 18);  (use langCroatian, langSerbian, etc.) 
  209. (defconstant $langChinese 19)   ;  (use langTradChinese or langSimpChinese) 
  210.  
  211. ;  Regional version codes 
  212.  
  213. (defconstant $verUS 0)
  214. (defconstant $verFrance 1)
  215. (defconstant $verBritain 2)
  216. (defconstant $verGermany 3)
  217. (defconstant $verItaly 4)
  218. (defconstant $verNetherlands 5)
  219. (defconstant $verFrBelgiumLux 6);  French for Belgium & Luxembourg 
  220. (defconstant $verSweden 7)
  221. (defconstant $verSpain 8)
  222. (defconstant $verDenmark 9)
  223. (defconstant $verPortugal 10)
  224. (defconstant $verFrCanada 11)
  225. (defconstant $verNorway 12)
  226. (defconstant $verIsrael 13)
  227. (defconstant $verJapan 14)
  228. (defconstant $verAustralia 15)
  229. (defconstant $verArabic 16)     ;  synonym for verArabia 
  230. (defconstant $verFinland 17)
  231. (defconstant $verFrSwiss 18)    ;  French Swiss 
  232. (defconstant $verGrSwiss 19)    ;  German Swiss 
  233. (defconstant $verGreece 20)
  234. (defconstant $verIceland 21)
  235. (defconstant $verMalta 22)
  236. (defconstant $verCyprus 23)
  237. (defconstant $verTurkey 24)
  238. (defconstant $verYugoCroatian 25);  Croatian system for Yugoslavia 
  239. (defconstant $verIndiaHindi 33) ;  Hindi system for India 
  240. (defconstant $verPakistan 34)
  241. (defconstant $verLithuania 41)
  242. (defconstant $verPoland 42)
  243. (defconstant $verHungary 43)
  244. (defconstant $verEstonia 44)
  245. (defconstant $verLatvia 45)
  246. (defconstant $verLapland 46)
  247. (defconstant $verFaeroeIsl 47)
  248. (defconstant $verIran 48)
  249. (defconstant $verRussia 49)
  250. (defconstant $verIreland 50)    ;  English-language version for Ireland 
  251. (defconstant $verKorea 51)
  252. (defconstant $verChina 52)
  253. (defconstant $verTaiwan 53)
  254. (defconstant $verThailand 54)
  255.  
  256. (defconstant $minCountry #$VERUS)
  257. (defconstant $maxCountry #$VERTHAILAND)
  258.  
  259. ; Obsolete region code names, kept for backward compatibility
  260.  
  261. (defconstant $verBelgiumLux 6)  ;  (use verFrBelgiumLux instead, less ambiguous) 
  262. (defconstant $verArabia 16)
  263. (defconstant $verYugoslavia 25) ;  (use verYugoCroatian instead, less ambiguous) 
  264. (defconstant $verIndia 33)      ;  (use verIndiaHindi instead, less ambiguous) 
  265.  
  266. ;  Calendar Codes 
  267.  
  268. (defconstant $calGregorian 0)
  269. (defconstant $calArabicCivil 1)
  270. (defconstant $calArabicLunar 2)
  271. (defconstant $calJapanese 3)
  272. (defconstant $calJewish 4)
  273. (defconstant $calCoptic 5)
  274. (defconstant $calPersian 6)
  275.  
  276. ;  Integer Format Codes 
  277.  
  278. (defconstant $intWestern 0)
  279. (defconstant $intArabic 1)
  280. (defconstant $intRoman 2)
  281. (defconstant $intJapanese 3)
  282. (defconstant $intEuropean 4)
  283. (defconstant $intOutputMask #X8000)
  284.  
  285. ;  CharByte byte types 
  286.  
  287. (defconstant $smSingleByte 0)
  288. (defconstant $smFirstByte -1)
  289. (defconstant $smLastByte 1)
  290. (defconstant $smMiddleByte 2)
  291.  
  292. ;  CharType field masks 
  293.  
  294. (defconstant $smcTypeMask #XF)
  295. (defconstant $smcReserved #XF0)
  296. (defconstant $smcClassMask #XF00)
  297. (defconstant $smcOrientationMask #X1000); two-byte script glyph orientation
  298. (defconstant $smcRightMask #X2000)
  299. (defconstant $smcUpperMask #X4000)
  300. (defconstant $smcDoubleMask #X8000)
  301.  
  302. ;  Basic CharType character types 
  303.  
  304. (defconstant $smCharPunct #X0)
  305. (defconstant $smCharAscii #X1)
  306. (defconstant $smCharEuro #X7)
  307. (defconstant $smCharExtAscii #X7);  More correct synonym for smCharEuro 
  308.  
  309. ;  Additional CharType character types for script systems 
  310.  
  311. (defconstant $smCharKatakana #X2); Japanese Katakana
  312. (defconstant $smCharHiragana #X3); Japanese Hiragana
  313. (defconstant $smCharIdeographic #X4); Hanzi, Kanji, Hanja
  314. (defconstant $smCharTwoByteGreek #X5); 2-byte Greek in Far East systems
  315. (defconstant $smCharTwoByteRussian #X6); 2-byte Cyrillic in Far East systems
  316. (defconstant $smCharBidirect #X8); Arabic/Hebrew
  317. (defconstant $smCharContextualLR #X9); Contextual left-right: Thai, Indic scripts
  318. (defconstant $smCharNonContextualLR #XA); Non-contextual left-right: Cyrillic, Greek
  319. (defconstant $smCharHangul #XC) ; Korean Hangul
  320. (defconstant $smCharJamo #XD)   ; Korean Jamo
  321. (defconstant $smCharBopomofo #XE); Chinese Bopomofo
  322.  
  323. ;  old names for some of above, for backward compatibility 
  324.  
  325. (defconstant $smCharFISKana #X2); Katakana
  326. (defconstant $smCharFISGana #X3); Hiragana
  327. (defconstant $smCharFISIdeo #X4); Hanzi, Kanji, Hanja
  328. (defconstant $smCharFISGreek #X5); 2-byte Greek in Far East systems
  329. (defconstant $smCharFISRussian #X6); 2-byte Cyrillic in Far East systems
  330.  
  331. ;  CharType classes for punctuation (smCharPunct) 
  332.  
  333. (defconstant $smPunctNormal #X0)
  334. (defconstant $smPunctNumber #X100)
  335. (defconstant $smPunctSymbol #X200)
  336. (defconstant $smPunctBlank #X300)
  337.  
  338. ;  Additional CharType classes for punctuation in two-byte systems 
  339.  
  340. (defconstant $smPunctRepeat #X400);  repeat marker 
  341. (defconstant $smPunctGraphic #X500);  line graphics 
  342.  
  343. ;  CharType Katakana and Hiragana classes for two-byte systems 
  344.  
  345. (defconstant $smKanaSmall #X100); small kana character
  346. (defconstant $smKanaHardOK #X200); can have dakuten
  347. (defconstant $smKanaSoftOK #X300); can have dakuten or han-dakuten
  348.  
  349. ;  CharType Ideographic classes for two-byte systems 
  350.  
  351. (defconstant $smIdeographicLevel1 #X0); level 1 char
  352. (defconstant $smIdeographicLevel2 #X100); level 2 char
  353. (defconstant $smIdeographicUser #X200); user char
  354.  
  355. ;  old names for above, for backward compatibility 
  356.  
  357. (defconstant $smFISClassLvl1 #X0); level 1 char
  358. (defconstant $smFISClassLvl2 #X100); level 2 char
  359. (defconstant $smFISClassUser #X200); user char
  360.  
  361. ;  CharType Jamo classes for Korean systems 
  362.  
  363. (defconstant $smJamoJaeum #X0)  ; simple consonant char
  364. (defconstant $smJamoBogJaeum #X100); complex consonant char
  365. (defconstant $smJamoMoeum #X200); simple vowel char
  366. (defconstant $smJamoBogMoeum #X300); complex vowel char
  367.  
  368. ;  CharType glyph orientation for two-byte systems 
  369.  
  370. (defconstant $smCharHorizontal #X0);  horizontal character form, or for both 
  371. (defconstant $smCharVertical #X1000);  vertical character form 
  372.  
  373. ;  CharType directions 
  374.  
  375. (defconstant $smCharLeft #X0)
  376. (defconstant $smCharRight #X2000)
  377.  
  378. ;  CharType case modifers 
  379.  
  380. (defconstant $smCharLower #X0)
  381. (defconstant $smCharUpper #X4000)
  382.  
  383. ;  CharType character size modifiers (1 or multiple bytes). 
  384.  
  385. (defconstant $smChar1byte #X0)
  386. (defconstant $smChar2byte #X8000)
  387.  
  388. ;  TransliterateText target types for Roman 
  389.  
  390. (defconstant $smTransAscii 0)   ; convert to ASCII
  391. (defconstant $smTransNative 1)  ; convert to font script
  392. (defconstant $smTransCase #XFE) ; convert case for all text
  393. (defconstant $smTransSystem #XFF); convert to system script
  394.  
  395. ;  TransliterateText target types for two-byte scripts 
  396.  
  397. (defconstant $smTransAscii1 2)  ; 1-byte Roman
  398. (defconstant $smTransAscii2 3)  ; 2-byte Roman
  399. (defconstant $smTransKana1 4)   ; 1-byte Japanese Katakana
  400. (defconstant $smTransKana2 5)   ; 2-byte Japanese Katakana
  401. (defconstant $smTransGana2 7)   ; 2-byte Japanese Hiragana (no 1-byte Hiragana)
  402. (defconstant $smTransHangul2 8) ; 2-byte Korean Hangul
  403. (defconstant $smTransJamo2 9)   ; 2-byte Korean Jamo
  404. (defconstant $smTransBopomofo2 10); 2-byte Chinese Bopomofo
  405.  
  406. ;  TransliterateText target modifiers 
  407.  
  408. (defconstant $smTransLower #X4000); target becomes lowercase
  409. (defconstant $smTransUpper #X8000); target becomes uppercase
  410.  
  411. ;  TransliterateText resource format numbers 
  412.  
  413. (defconstant $smTransRuleBaseFormat 1); Rule based trsl resource format 
  414. (defconstant $smTransHangulFormat 2); Table based Hangul trsl resource format
  415.  
  416. ;  TransliterateText property flags 
  417.  
  418. (defconstant $smTransPreDoubleByting 1); Convert all text to double byte before transliteration
  419. (defconstant $smTransPreLowerCasing 2); Convert all text to lower case before transliteration
  420.  
  421. ;  TransliterateText source mask - general 
  422.  
  423. (defconstant $smMaskAll #XFFFFFFFF); Convert all text
  424.  
  425. ;  TransliterateText source masks 
  426.  
  427. (defconstant $smMaskAscii #X1)  ; 2^smTransAscii
  428. (defconstant $smMaskNative #X2) ; 2^smTransNative
  429.  
  430. ;  TransliterateText source masks for two-byte scripts 
  431.  
  432. (defconstant $smMaskAscii1 #X4) ; 2^smTransAscii1
  433. (defconstant $smMaskAscii2 #X8) ; 2^smTransAscii2
  434. (defconstant $smMaskKana1 #X10) ; 2^smTransKana1
  435. (defconstant $smMaskKana2 #X20) ; 2^smTransKana2
  436. (defconstant $smMaskGana2 #X80) ; 2^smTransGana2
  437. (defconstant $smMaskHangul2 #X100); 2^smTransHangul2
  438. (defconstant $smMaskJamo2 #X200); 2^smTransJamo2
  439. (defconstant $smMaskBopomofo2 #X400); 2^smTransBopomofo2
  440.  
  441. ;  Result values from GetSMVariable, SetSMVariable, GetScriptVariable and SetScriptVariable calls. 
  442.  
  443. (defconstant $smNotInstalled 0) ; routine not available in script
  444. (defconstant $smBadVerb -1)     ; Bad verb passed to a routine
  445. (defconstant $smBadScript -2)   ; Bad script code passed to a routine
  446.  
  447. ;  Values for script redraw flag. 
  448.  
  449. (defconstant $smRedrawChar 0)   ; Redraw character only
  450. (defconstant $smRedrawWord 1)   ; Redraw entire word (2-byte systems)
  451. (defconstant $smRedrawLine -1)  ; Redraw entire line (bidirectional systems)
  452.  
  453. ;  GetSMVariable and SetSMVariable verbs 
  454.  
  455. (defconstant $smVersion 0)      ; Script Manager version number
  456. (defconstant $smMunged 2)       ; Globals change count
  457. (defconstant $smEnabled 4)      ; Count of enabled scripts, incl Roman
  458. (defconstant $smBidirect 6)     ; At least one bidirectional script
  459. (defconstant $smFontForce 8)    ; Force font flag
  460. (defconstant $smIntlForce 10)   ; Force intl flag
  461. (defconstant $smForced 12)      ; Script was forced to system script
  462. (defconstant $smDefault 14)     ; Script was defaulted to Roman script
  463. (defconstant $smPrint 16)       ; Printer action routine
  464. (defconstant $smSysScript 18)   ; System script
  465. (defconstant $smLastScript 20)  ; Last keyboard script
  466. (defconstant $smKeyScript 22)   ; Keyboard script
  467. (defconstant $smSysRef 24)      ; System folder refNum
  468. (defconstant $smKeyCache 26)    ; obsolete
  469. (defconstant $smKeySwap 28)     ; Swapping table handle
  470. (defconstant $smGenFlags 30)    ; General flags long
  471. (defconstant $smOverride 32)    ; Script override flags
  472. (defconstant $smCharPortion 34) ; Ch vs SpExtra proportion
  473.  
  474. ;  New for System 7.0: 
  475.  
  476. (defconstant $smDoubleByte 36)  ; Flag for double-byte script installed
  477. (defconstant $smKCHRCache 38)   ; Returns pointer to KCHR cache
  478. (defconstant $smRegionCode 40)  ; Returns current region code (verXxx)
  479. (defconstant $smKeyDisableState 42); Returns current keyboard disable state
  480.  
  481. ;  GetScriptVariable and SetScriptVariable verbs.
  482. ; Note: Verbs private to script systems are negative, while
  483. ; those general across script systems are non-negative. 
  484.  
  485. (defconstant $smScriptVersion 0); Script software version
  486. (defconstant $smScriptMunged 2) ; Script entry changed count
  487. (defconstant $smScriptEnabled 4); Script enabled flag
  488. (defconstant $smScriptRight 6)  ; Right to left flag
  489. (defconstant $smScriptJust 8)   ; Justification flag
  490. (defconstant $smScriptRedraw 10); Word redraw flag
  491. (defconstant $smScriptSysFond 12); Preferred system font
  492. (defconstant $smScriptAppFond 14); Preferred Application font
  493. (defconstant $smScriptBundle 16); Beginning of itlb verbs
  494. (defconstant $smScriptNumber 16); Script itl0 id
  495. (defconstant $smScriptDate 18)  ; Script itl1 id
  496. (defconstant $smScriptSort 20)  ; Script itl2 id
  497. (defconstant $smScriptFlags 22) ; flags word
  498. (defconstant $smScriptToken 24) ; Script itl4 id
  499. (defconstant $smScriptEncoding 26); id of optional itl5, if present
  500. (defconstant $smScriptLang 28)  ; Current language for script
  501. (defconstant $smScriptNumDate 30); Script Number/Date formats.
  502. (defconstant $smScriptKeys 32)  ; Script KCHR id
  503. (defconstant $smScriptIcon 34)  ; ID # of SICN or kcs#/kcs4/kcs8 suite
  504. (defconstant $smScriptPrint 36) ; Script printer action routine
  505. (defconstant $smScriptTrap 38)  ; Trap entry pointer
  506. (defconstant $smScriptCreator 40); Script file creator
  507. (defconstant $smScriptFile 42)  ; Script file name
  508. (defconstant $smScriptName 44)  ; Script name
  509.  
  510. ;  There is a hole here for old Kanji private verbs 46-76 
  511. ;  New for System 7.0: 
  512.  
  513. (defconstant $smScriptMonoFondSize 78); default monospace FOND (hi) & size (lo)
  514. (defconstant $smScriptPrefFondSize 80); preferred FOND (hi) & size (lo)
  515. (defconstant $smScriptSmallFondSize 82); default small FOND (hi) & size (lo)
  516. (defconstant $smScriptSysFondSize 84); default system FOND (hi) & size (lo)
  517. (defconstant $smScriptAppFondSize 86); default app FOND (hi) & size (lo)
  518. (defconstant $smScriptHelpFondSize 88); default Help Mgr FOND (hi) & size (lo)
  519. (defconstant $smScriptValidStyles 90); mask of valid styles for script
  520. (defconstant $smScriptAliasStyle 92); style (set) to use for aliases
  521.  
  522. ;  Special script code values for International Utilities 
  523.  
  524. (defconstant $iuSystemScript -1);  <obsolete>  system script 
  525. (defconstant $iuCurrentScript -2);  <obsolete>  current script (for font of grafPort) 
  526.  
  527. ;  Negative verbs for KeyScript 
  528.  
  529. (defconstant $smKeyNextScript -1);  Switch to next available script 
  530. (defconstant $smKeySysScript -2);  Switch to the system script 
  531. (defconstant $smKeySwapScript -3);  Switch to previously-used script 
  532.  
  533. ;  New for System 7.0: 
  534.  
  535. (defconstant $smKeyNextKybd -4) ;  Switch to next keyboard in current keyscript 
  536. (defconstant $smKeySwapKybd -5) ;  Switch to previously-used keyboard in current keyscript 
  537.  
  538. (defconstant $smKeyDisableKybds -6);  Disable keyboards not in system or Roman script 
  539. (defconstant $smKeyEnableKybds -7);  Re-enable keyboards for all enabled scripts 
  540. (defconstant $smKeyToggleInline -8);  Toggle inline input for current keyscript 
  541. (defconstant $smKeyToggleDirection -9);  Toggle default line direction (TESysJust) 
  542. (defconstant $smKeyNextInputMethod -10);  Switch to next input method in current keyscript 
  543. (defconstant $smKeySwapInputMethod -11);  Switch to last-used input method in current keyscript 
  544.  
  545. (defconstant $smKeyDisableKybdSwitch -12);  Disable switching from the current keyboard 
  546.  
  547. (defconstant $smKeySetDirLeftRight -15);  Set default line dir to left-right, align left 
  548. (defconstant $smKeySetDirRightLeft -16);  Set default line dir to right-left, align right 
  549. (defconstant $smKeyRoman -17)   ;  Set keyscript to Roman. Does nothing if Roman-only
  550. ;                                         system, unlike KeyScript(smRoman) which forces
  551. ;                                         an update to current default Roman keyboard 
  552.  
  553. ;  Bits in the smScriptFlags word
  554. ; (bits above 8 are non-static) 
  555.  
  556. (defconstant $smsfIntellCP 0)   ; Script has intelligent cut & paste
  557. (defconstant $smsfSingByte 1)   ; Script has only single bytes
  558. (defconstant $smsfNatCase 2)    ; Native chars have upper & lower case
  559. (defconstant $smsfContext 3)    ; Script is contextual
  560. (defconstant $smsfNoForceFont 4); Script will not force characters
  561. (defconstant $smsfB0Digits 5)   ; Script has alternate digits at B0-B9
  562. (defconstant $smsfAutoInit 6)   ; Auto initialize the script
  563. (defconstant $smsfUnivExt 7)    ; Script is handled by universal extension
  564. (defconstant $smsfSynchUnstyledTE 8); Script synchronizes for unstyled TE
  565. (defconstant $smsfForms 13)     ; Uses contextual forms for letters
  566. (defconstant $smsfLigatures 14) ; Uses contextual ligatures
  567. (defconstant $smsfReverse 15)   ; Reverses native text, right-left
  568.  
  569. ;  Bits in the smGenFlags long.
  570. ; First (high-order) byte is set from itlc flags byte. 
  571.  
  572. (defconstant $smfShowIcon 31)   ; Show icon even if only one script
  573. (defconstant $smfDualCaret 30)  ; Use dual caret for mixed direction text
  574. (defconstant $smfNameTagEnab 29); Reserved for internal use
  575. (defconstant $smfUseAssocFontInfo 28); Use the associated font info for FontMetrics calls 
  576.  
  577. ;  Roman script constants 
  578. ;  The following are here for backward compatibility, but should not be used. 
  579. ;  This information should be obtained using GetScript. 
  580.  
  581. (defconstant $romanSysFond #X3FFF); system font id number
  582. (defconstant $romanAppFond 3)   ; application font id number
  583. (defconstant $romanFlags #X7)   ; roman settings
  584.  
  585. ;  Script Manager font equates. 
  586.  
  587. (defconstant $smFondStart #X4000); start from 16K
  588. (defconstant $smFondEnd #XC000) ; past end of range at 48K
  589.  
  590. ;  Miscellaneous font equates. 
  591.  
  592. (defconstant $smUprHalfCharSet #X80); first char code in top half of std char set
  593.  
  594. ;  Character Set Extensions 
  595.  
  596. (defconstant $diaeresisUprY #XD9)
  597. (defconstant $fraction #XDA)
  598. (defconstant $intlCurrency #XDB)
  599. (defconstant $leftSingGuillemet #XDC)
  600. (defconstant $rightSingGuillemet #XDD)
  601. (defconstant $fiLigature #XDE)
  602. (defconstant $flLigature #XDF)
  603. (defconstant $dblDagger #XE0)
  604. (defconstant $centeredDot #XE1)
  605. (defconstant $baseSingQuote #XE2)
  606. (defconstant $baseDblQuote #XE3)
  607. (defconstant $perThousand #XE4)
  608. (defconstant $circumflexUprA #XE5)
  609. (defconstant $circumflexUprE #XE6)
  610. (defconstant $acuteUprA #XE7)
  611. (defconstant $diaeresisUprE #XE8)
  612. (defconstant $graveUprE #XE9)
  613. (defconstant $acuteUprI #XEA)
  614. (defconstant $circumflexUprI #XEB)
  615. (defconstant $diaeresisUprI #XEC)
  616. (defconstant $graveUprI #XED)
  617. (defconstant $acuteUprO #XEE)
  618. (defconstant $circumflexUprO #XEF)
  619. (defconstant $appleLogo #XF0)
  620. (defconstant $graveUprO #XF1)
  621. (defconstant $acuteUprU #XF2)
  622. (defconstant $circumflexUprU #XF3)
  623. (defconstant $graveUprU #XF4)
  624. (defconstant $dotlessLwrI #XF5)
  625. (defconstant $circumflex #XF6)
  626. (defconstant $tilde #XF7)
  627. (defconstant $macron #XF8)
  628. (defconstant $breveMark #XF9)
  629. (defconstant $overDot #XFA)
  630. (defconstant $ringMark #XFB)
  631. (defconstant $cedilla #XFC)
  632. (defconstant $doubleAcute #XFD)
  633. (defconstant $ogonek #XFE)
  634. (defconstant $hachek #XFF)
  635.  
  636. ;  TokenType values 
  637.  
  638. (defconstant $tokenIntl 4)      ; the itl resource number of the tokenizer
  639. (defconstant $tokenEmpty -1)    ; used internally as an empty flag
  640. (defconstant $tokenUnknown 0)   ; chars that do not match a defined token type
  641. (defconstant $tokenWhite 1)     ; white space
  642. (defconstant $tokenLeftLit 2)   ; literal begin
  643. (defconstant $tokenRightLit 3)  ; literal end
  644. (defconstant $tokenAlpha 4)     ; alphabetic
  645. (defconstant $tokenNumeric 5)   ; numeric
  646. (defconstant $tokenNewLine 6)   ; new line
  647. (defconstant $tokenLeftComment 7); open comment
  648. (defconstant $tokenRightComment 8); close comment
  649. (defconstant $tokenLiteral 9)   ; literal
  650. (defconstant $tokenEscape 10)   ; character escape (e.g. '\' in "\n", "\t")
  651. (defconstant $tokenAltNum 11)   ; alternate number (e.g. $B0-B9 in Arabic,Hebrew)
  652. (defconstant $tokenRealNum 12)  ; real number
  653. (defconstant $tokenAltReal 13)  ; alternate real number
  654. (defconstant $tokenReserve1 14) ; reserved
  655. (defconstant $tokenReserve2 15) ; reserved
  656. (defconstant $tokenLeftParen 16); open parenthesis
  657. (defconstant $tokenRightParen 17); close parenthesis
  658. (defconstant $tokenLeftBracket 18); open square bracket
  659. (defconstant $tokenRightBracket 19); close square bracket
  660. (defconstant $tokenLeftCurly 20); open curly bracket
  661. (defconstant $tokenRightCurly 21); close curly bracket
  662. (defconstant $tokenLeftEnclose 22); open guillemet
  663. (defconstant $tokenRightEnclose 23); close guillemet
  664. (defconstant $tokenPlus 24)
  665. (defconstant $tokenMinus 25)
  666. (defconstant $tokenAsterisk 26) ; times/multiply
  667. (defconstant $tokenDivide 27)
  668. (defconstant $tokenPlusMinus 28); plus or minus symbol
  669. (defconstant $tokenSlash 29)
  670. (defconstant $tokenBackSlash 30)
  671. (defconstant $tokenLess 31)     ; less than symbol
  672. (defconstant $tokenGreat 32)    ; greater than symbol
  673. (defconstant $tokenEqual 33)
  674. (defconstant $tokenLessEqual2 34); less than or equal, 2 characters (e.g. <=)
  675. (defconstant $tokenLessEqual1 35); less than or equal, 1 character
  676. (defconstant $tokenGreatEqual2 36); greater than or equal, 2 characters (e.g. >=)
  677. (defconstant $tokenGreatEqual1 37); greater than or equal, 1 character
  678. (defconstant $token2Equal 38)   ; double equal (e.g. ==)
  679. (defconstant $tokenColonEqual 39); colon equal
  680. (defconstant $tokenNotEqual 40) ; not equal, 1 character
  681. (defconstant $tokenLessGreat 41); less/greater, Pascal not equal (e.g. <>)
  682. (defconstant $tokenExclamEqual 42); exclamation equal, C not equal (e.g. !=)
  683. (defconstant $tokenExclam 43)   ; exclamation point
  684. (defconstant $tokenTilde 44)    ; centered tilde
  685. (defconstant $tokenComma 45)
  686. (defconstant $tokenPeriod 46)
  687. (defconstant $tokenLeft2Quote 47); open double quote
  688. (defconstant $tokenRight2Quote 48); close double quote
  689. (defconstant $tokenLeft1Quote 49); open single quote
  690. (defconstant $tokenRight1Quote 50); close single quote
  691. (defconstant $token2Quote 51)   ; double quote
  692. (defconstant $token1Quote 52)   ; single quote
  693. (defconstant $tokenSemicolon 53)
  694. (defconstant $tokenPercent 54)
  695. (defconstant $tokenCaret 55)
  696. (defconstant $tokenUnderline 56)
  697. (defconstant $tokenAmpersand 57)
  698. (defconstant $tokenAtSign 58)
  699. (defconstant $tokenBar 59)      ; vertical bar
  700. (defconstant $tokenQuestion 60)
  701. (defconstant $tokenPi 61)       ; lower-case pi
  702. (defconstant $tokenRoot 62)     ; square root symbol
  703. (defconstant $tokenSigma 63)    ; capital sigma
  704. (defconstant $tokenIntegral 64) ; integral sign
  705. (defconstant $tokenMicro 65)
  706. (defconstant $tokenCapPi 66)    ; capital pi
  707. (defconstant $tokenInfinity 67)
  708. (defconstant $tokenColon 68)
  709. (defconstant $tokenHash 69)     ; e.g. #
  710. (defconstant $tokenDollar 70)
  711. (defconstant $tokenNoBreakSpace 71); non-breaking space
  712. (defconstant $tokenFraction 72)
  713. (defconstant $tokenIntlCurrency 73)
  714. (defconstant $tokenLeftSingGuillemet 74)
  715. (defconstant $tokenRightSingGuillemet 75)
  716. (defconstant $tokenPerThousand 76)
  717. (defconstant $tokenEllipsis 77)
  718. (defconstant $tokenCenterDot 78)
  719. (defconstant $tokenNil 127)
  720. (defconstant $delimPad -2)
  721.  
  722. ;  obsolete, misspelled token names kept for backward compatibility 
  723.  
  724. (defconstant $tokenTilda 44)
  725. (defconstant $tokenCarat 55)
  726.  
  727. ;  Table selectors for GetItlTable 
  728.  
  729. (defconstant $smWordSelectTable 0);  get word select break table from 'itl2' 
  730. (defconstant $smWordWrapTable 1);  get word wrap break table from 'itl2' 
  731. (defconstant $smNumberPartsTable 2);  get default number parts table from 'itl4' 
  732. (defconstant $smUnTokenTable 3) ;  get unToken table from 'itl4' 
  733. (defconstant $smWhiteSpaceList 4);  get white space list from 'itl4' 
  734.  
  735. (defconstant $iuWordSelectTable 0);  <obsolete>  get word select break table from 'itl2' 
  736. (defconstant $iuWordWrapTable 1);  <obsolete>  get word wrap break table from 'itl2' 
  737. (defconstant $iuNumberPartsTable 2);  <obsolete>  get default number parts table from 'itl4' 
  738. (defconstant $iuUnTokenTable 3) ;  <obsolete>  get unToken table from 'itl4' 
  739. (defconstant $iuWhiteSpaceList 4);  <obsolete>  get white space list from 'itl4' 
  740.  
  741. (def-mactype :TOKENRESULTS (find-mactype :UNSIGNED-BYTE))
  742. (defconstant $tokenOK 0)
  743. (defconstant $tokenOverflow 1)
  744. (defconstant $stringOverflow 2)
  745. (defconstant $badDelim 3)
  746. (defconstant $badEnding 4)
  747. (defconstant $crash 5)
  748.  
  749. (defrecord CharByteTable (array (ARRAY :SIGNED-BYTE 256)))
  750.  
  751. (def-mactype :TOKENTYPE (find-mactype :SIGNED-INTEGER))
  752. (defrecord DelimType (array (ARRAY :SIGNED-INTEGER 2)))
  753. (defrecord CommentType (array (ARRAY :SIGNED-INTEGER 4)))
  754.  
  755. (def-mactype :TOKENRECPTR (find-mactype :POINTER))
  756. (defrecord TokenRec 
  757.    (theToken :SIGNED-INTEGER)
  758.    (position :POINTER)          ; pointer into original source
  759.    (length :SIGNED-LONG)        ; length of text in original source
  760.    (stringPosition (:POINTER (:STRING 255))); Pascal/C string copy of identifier
  761.    )
  762.  
  763. (def-mactype :TOKENBLOCKPTR (find-mactype :POINTER))
  764. (defrecord TokenBlock 
  765.    (source :POINTER)            ; pointer to stream of characters
  766.    (sourceLength :SIGNED-LONG)  ; length of source stream
  767.    (tokenList :POINTER)         ; pointer to array of tokens
  768.    (tokenLength :SIGNED-LONG)   ; maximum length of TokenList
  769.    (tokenCount :SIGNED-LONG)    ; number tokens generated by tokenizer
  770.    (stringList :POINTER)        ; pointer to stream of identifiers
  771.    (stringLength :SIGNED-LONG)  ; length of string list
  772.    (stringCount :SIGNED-LONG)   ; number of bytes currently used
  773.    (doString :BOOLEAN)          ; make strings & put into StringList
  774.    (doAppend :BOOLEAN)          ; append to TokenList rather than replace
  775.    (doAlphanumeric :BOOLEAN)    ; identifiers may include numeric
  776.    (doNest :BOOLEAN)            ; do comments nest?
  777.    (leftDelims (:ARRAY :SIGNED-INTEGER 2))
  778.    (rightDelims (:ARRAY :SIGNED-INTEGER 2))
  779.    (leftComment (:ARRAY :SIGNED-INTEGER 4))
  780.    (rightComment (:ARRAY :SIGNED-INTEGER 4))
  781.    (escapeCode :SIGNED-INTEGER) ; escape symbol code
  782.    (decimalCode :SIGNED-INTEGER)
  783.    (itlResource :HANDLE)        ; handle to itl4 resource of current script
  784.    (reserved (:ARRAY :SIGNED-LONG 8)); must be zero!
  785.    )
  786.  
  787.  
  788. (deftrap _fontscript nil
  789.    (:stack :signed-integer)
  790.    (:stack-trap #xA8B5 ((+ (ash 33280 16) 0) :signed-longint)))
  791.  
  792. (deftrap _intlscript nil
  793.    (:stack :signed-integer)
  794.    (:stack-trap #xA8B5 ((+ (ash 33280 16) 2) :signed-longint)))
  795.  
  796. (deftrap _keyscript ((code :signed-integer))
  797.    nil
  798.    (:stack-trap #xA8B5 code ((+ (ash 32770 16) 4) :signed-longint)))
  799.  
  800. (deftrap _charbyte ((textbuf :pointer) (textoffset :signed-integer))
  801.    (:stack :signed-integer)
  802.    (:stack-trap #xA8B5 textbuf textoffset ((+ (ash 33286 16) 16) :signed-longint)))
  803.  
  804. (deftrap _chartype ((textbuf :pointer) (textoffset :signed-integer))
  805.    (:stack :signed-integer)
  806.    (:stack-trap #xA8B5 textbuf textoffset ((+ (ash 33286 16) 18) :signed-longint)))
  807.  
  808. (deftrap _transliterate ((srchandle :handle) (dsthandle :handle) (target :signed-integer) (srcmask :signed-long))
  809.    (:stack :signed-integer)
  810.    (:stack-trap #xA8B5 srchandle dsthandle target srcmask ((+ (ash 33294 16) 24) :signed-longint)))
  811.  
  812. (deftrap _parsetable ((table (:pointer :charbytetable)))
  813.    (:stack :boolean)
  814.    (:stack-trap #xA8B5 table ((+ (ash 33284 16) 34) :signed-longint)))
  815.  
  816. (deftrap _getsysdirection nil
  817.    (:no-trap :signed-integer)
  818.    (:no-trap (%get-signed-word (%int-to-ptr 2988))))
  819.  
  820. (deftrap _getsysjust nil
  821.    (:no-trap :signed-integer)
  822.    (:no-trap (%get-signed-word (%int-to-ptr 2988))))
  823.  
  824. (deftrap _setsysdirection ((newjust :signed-integer))
  825.    nil
  826.    (:no-trap (%put-word (%int-to-ptr 2988) newjust)))
  827.  
  828. (deftrap _setsysjust ((newjust :signed-integer))
  829.    nil
  830.    (:no-trap (%put-word (%int-to-ptr 2988) newjust)))
  831.  
  832. (deftrap _intltokenize ((tokenparam (:pointer :tokenblock)))
  833.    (:stack :unsigned-byte)
  834.    (:stack-trap #xA8B5 tokenparam ((+ (ash 33284 16) 65530) :signed-longint)))
  835.  
  836. (deftrap _fonttoscript ((fontnumber :signed-integer))
  837.    (:stack :signed-integer)
  838.    (:stack-trap #xA8B5 fontnumber ((+ (ash 33282 16) 6) :signed-longint)))
  839.  
  840. (deftrap _font2script ((fontnumber :signed-integer))
  841.    (:stack :signed-integer)
  842.    (:stack-trap #xA8B5 fontnumber ((+ (ash 33282 16) 6) :signed-longint)))
  843.  
  844. (deftrap _getsmvariable ((selector :signed-integer))
  845.    (:stack :signed-long)
  846.    (:stack-trap #xA8B5 selector ((+ (ash 33794 16) 8) :signed-longint)))
  847.  
  848. (deftrap _getenvirons ((verb :signed-integer))
  849.    (:stack :signed-long)
  850.    (:stack-trap #xA8B5 verb ((+ (ash 33794 16) 8) :signed-longint)))
  851.  
  852. (deftrap _setsmvariable ((selector :signed-integer) (param :signed-long))
  853.    (:stack :signed-integer)
  854.    (:stack-trap #xA8B5 selector param ((+ (ash 33286 16) 10) :signed-longint)))
  855.  
  856. (deftrap _setenvirons ((verb :signed-integer) (param :signed-long))
  857.    (:stack :signed-integer)
  858.    (:stack-trap #xA8B5 verb param ((+ (ash 33286 16) 10) :signed-longint)))
  859.  
  860. (deftrap _getscriptvariable ((script :signed-integer) (selector :signed-integer))
  861.    (:stack :signed-long)
  862.    (:stack-trap #xA8B5 script selector ((+ (ash 33796 16) 12) :signed-longint)))
  863.  
  864. (deftrap _getscript ((script :signed-integer) (verb :signed-integer))
  865.    (:stack :signed-long)
  866.    (:stack-trap #xA8B5 script verb ((+ (ash 33796 16) 12) :signed-longint)))
  867.  
  868. (deftrap _setscriptvariable ((script :signed-integer) (selector :signed-integer) (param :signed-long))
  869.    (:stack :signed-integer)
  870.    (:stack-trap #xA8B5 script selector param ((+ (ash 33288 16) 14) :signed-longint)))
  871.  
  872. (deftrap _setscript ((script :signed-integer) (verb :signed-integer) (param :signed-long))
  873.    (:stack :signed-integer)
  874.    (:stack-trap #xA8B5 script verb param ((+ (ash 33288 16) 14) :signed-longint)))
  875.  
  876. ;   New for 7.1  
  877.  
  878.  
  879. (deftrap _getscriptutilityaddress ((selector :signed-integer) (before :boolean) (script :signed-integer))
  880.    (:stack :pointer)
  881.    (:stack-trap #xA8B5 selector before script ((+ (ash 50180 16) 56) :signed-longint)))
  882.  
  883. (deftrap _setscriptutilityaddress ((selector :signed-integer) (before :boolean) (routineaddr :pointer) (script :signed-integer))
  884.    nil
  885.    (:stack-trap #xA8B5 selector before routineaddr script ((+ (ash 49160 16) 58) :signed-longint)))
  886.  
  887. (deftrap _getscriptqdpatchaddress ((trapnum :signed-integer) (before :boolean) (forprinting :boolean) (script :signed-integer))
  888.    (:stack :pointer)
  889.    (:stack-trap #xA8B5 trapnum before forprinting script ((+ (ash 50182 16) 60) :signed-longint)))
  890.  
  891. (deftrap _setscriptqdpatchaddress ((trapnum :signed-integer) (before :boolean) (forprinting :boolean) (routineaddr :pointer) (script :signed-integer))
  892.    nil
  893.    (:stack-trap #xA8B5 trapnum before forprinting routineaddr script ((+ (ash 49162 16) 62) :signed-longint)))
  894.  
  895.  
  896. (deftrap _characterbytetype ((textbuf :pointer) (textoffset :signed-integer) (script :signed-integer))
  897.    (:stack :signed-integer)
  898.    (:stack-trap #xA8B5 textbuf textoffset script ((+ (ash 49670 16) 16) :signed-longint)))
  899.  
  900. (deftrap _charactertype ((textbuf :pointer) (textoffset :signed-integer) (script :signed-integer))
  901.    (:stack :signed-integer)
  902.    (:stack-trap #xA8B5 textbuf textoffset script ((+ (ash 49670 16) 18) :signed-longint)))
  903.  
  904. (deftrap _transliteratetext ((srchandle :handle) (dsthandle :handle) (target :signed-integer) (srcmask :signed-long) (script :signed-integer))
  905.    (:stack :signed-integer)
  906.    (:stack-trap #xA8B5 srchandle dsthandle target srcmask script ((+ (ash 49678 16) 24) :signed-longint)))
  907.  
  908. (deftrap _fillparsetable ((table (:pointer :charbytetable)) (script :signed-integer))
  909.    (:stack :boolean)
  910.    (:stack-trap #xA8B5 table script ((+ (ash 49668 16) 34) :signed-longint)))
  911.  
  912. ;   Moved from packages.p  
  913.  
  914.  
  915. (deftrap _getintlresource ((theid :signed-integer))
  916.    (:stack :handle)
  917.    (:stack-trap #xA9ED theid (6 :signed-integer)))
  918.  
  919. (deftrap _iugetintl ((theid :signed-integer))
  920.    (:stack :handle)
  921.    (:stack-trap #xA9ED theid (6 :signed-integer)))
  922.  
  923. (deftrap _iusetintl ((refnum :signed-integer) (theid :signed-integer) (intlhandle :handle))
  924.    nil
  925.    (:stack-trap #xA9ED refnum theid intlhandle (8 :signed-integer)))
  926.  
  927. (deftrap _clearintlresourcecache nil
  928.    nil
  929.    (:stack-trap #xA9ED (24 :signed-integer)))
  930.  
  931. (deftrap _iuclearcache nil
  932.    nil
  933.    (:stack-trap #xA9ED (24 :signed-integer)))
  934.  
  935.  
  936. (deftrap _getintlresourcetable ((script :signed-integer) (tablecode :signed-integer) (itlhandle (:pointer :handle)) (offset (:pointer :signed-long)) (length (:pointer :signed-long)))
  937.    nil
  938.    (:stack-trap #xA9ED script tablecode itlhandle offset length (36 :signed-integer)))
  939.  
  940. (deftrap _iugetitltable ((script :signed-integer) (tablecode :signed-integer) (itlhandle (:pointer :handle)) (offset (:pointer :signed-long)) (length (:pointer :signed-long)))
  941.    nil
  942.    (:stack-trap #xA9ED script tablecode itlhandle offset length (36 :signed-integer)))
  943.  
  944. ; $ENDC                         ;  UsingScript 
  945.  
  946. ; $IFC NOT UsingIncludes
  947.  
  948. ; $ENDC
  949.  
  950.  
  951. (export '($CRASH $BADENDING $BADDELIM $STRINGOVERFLOW $TOKENOVERFLOW $TOKENOK
  952.           $IUWHITESPACELIST $IUUNTOKENTABLE $IUNUMBERPARTSTABLE
  953.           $IUWORDWRAPTABLE $IUWORDSELECTTABLE $SMWHITESPACELIST $SMUNTOKENTABLE
  954.           $SMNUMBERPARTSTABLE $SMWORDWRAPTABLE $SMWORDSELECTTABLE $TOKENCARAT
  955.           $TOKENTILDA $DELIMPAD $TOKENNIL $TOKENCENTERDOT $TOKENELLIPSIS
  956.           $TOKENPERTHOUSAND $TOKENRIGHTSINGGUILLEMET $TOKENLEFTSINGGUILLEMET
  957.           $TOKENINTLCURRENCY $TOKENFRACTION $TOKENNOBREAKSPACE $TOKENDOLLAR
  958.           $TOKENHASH $TOKENCOLON $TOKENINFINITY $TOKENCAPPI $TOKENMICRO
  959.           $TOKENINTEGRAL $TOKENSIGMA $TOKENROOT $TOKENPI $TOKENQUESTION
  960.           $TOKENBAR $TOKENATSIGN $TOKENAMPERSAND $TOKENUNDERLINE $TOKENCARET
  961.           $TOKENPERCENT $TOKENSEMICOLON $TOKEN1QUOTE $TOKEN2QUOTE
  962.           $TOKENRIGHT1QUOTE $TOKENLEFT1QUOTE $TOKENRIGHT2QUOTE $TOKENLEFT2QUOTE
  963.           $TOKENPERIOD $TOKENCOMMA $TOKENTILDE $TOKENEXCLAM $TOKENEXCLAMEQUAL
  964.           $TOKENLESSGREAT $TOKENNOTEQUAL $TOKENCOLONEQUAL $TOKEN2EQUAL
  965.           $TOKENGREATEQUAL1 $TOKENGREATEQUAL2 $TOKENLESSEQUAL1 $TOKENLESSEQUAL2
  966.           $TOKENEQUAL $TOKENGREAT $TOKENLESS $TOKENBACKSLASH $TOKENSLASH
  967.           $TOKENPLUSMINUS $TOKENDIVIDE $TOKENASTERISK $TOKENMINUS $TOKENPLUS
  968.           $TOKENRIGHTENCLOSE $TOKENLEFTENCLOSE $TOKENRIGHTCURLY $TOKENLEFTCURLY
  969.           $TOKENRIGHTBRACKET $TOKENLEFTBRACKET $TOKENRIGHTPAREN $TOKENLEFTPAREN
  970.           $TOKENRESERVE2 $TOKENRESERVE1 $TOKENALTREAL $TOKENREALNUM
  971.           $TOKENALTNUM $TOKENESCAPE $TOKENLITERAL $TOKENRIGHTCOMMENT
  972.           $TOKENLEFTCOMMENT $TOKENNEWLINE $TOKENNUMERIC $TOKENALPHA
  973.           $TOKENRIGHTLIT $TOKENLEFTLIT $TOKENWHITE $TOKENUNKNOWN $TOKENEMPTY
  974.           $TOKENINTL $HACHEK $OGONEK $DOUBLEACUTE $CEDILLA $RINGMARK $OVERDOT
  975.           $BREVEMARK $MACRON $TILDE $CIRCUMFLEX $DOTLESSLWRI $GRAVEUPRU
  976.           $CIRCUMFLEXUPRU $ACUTEUPRU $GRAVEUPRO $APPLELOGO $CIRCUMFLEXUPRO
  977.           $ACUTEUPRO $GRAVEUPRI $DIAERESISUPRI $CIRCUMFLEXUPRI $ACUTEUPRI
  978.           $GRAVEUPRE $DIAERESISUPRE $ACUTEUPRA $CIRCUMFLEXUPRE $CIRCUMFLEXUPRA
  979.           $PERTHOUSAND $BASEDBLQUOTE $BASESINGQUOTE $CENTEREDDOT $DBLDAGGER
  980.           $FLLIGATURE $FILIGATURE $RIGHTSINGGUILLEMET $LEFTSINGGUILLEMET
  981.           $INTLCURRENCY $FRACTION $DIAERESISUPRY $SMUPRHALFCHARSET $SMFONDEND
  982.           $SMFONDSTART $ROMANFLAGS $ROMANAPPFOND $ROMANSYSFOND
  983.           $SMFUSEASSOCFONTINFO $SMFNAMETAGENAB $SMFDUALCARET $SMFSHOWICON
  984.           $SMSFREVERSE $SMSFLIGATURES $SMSFFORMS $SMSFSYNCHUNSTYLEDTE
  985.           $SMSFUNIVEXT $SMSFAUTOINIT $SMSFB0DIGITS $SMSFNOFORCEFONT
  986.           $SMSFCONTEXT $SMSFNATCASE $SMSFSINGBYTE $SMSFINTELLCP $SMKEYROMAN
  987.           $SMKEYSETDIRRIGHTLEFT $SMKEYSETDIRLEFTRIGHT $SMKEYDISABLEKYBDSWITCH
  988.           $SMKEYSWAPINPUTMETHOD $SMKEYNEXTINPUTMETHOD $SMKEYTOGGLEDIRECTION
  989.           $SMKEYTOGGLEINLINE $SMKEYENABLEKYBDS $SMKEYDISABLEKYBDS
  990.           $SMKEYSWAPKYBD $SMKEYNEXTKYBD $SMKEYSWAPSCRIPT $SMKEYSYSSCRIPT
  991.           $SMKEYNEXTSCRIPT $IUCURRENTSCRIPT $IUSYSTEMSCRIPT $SMSCRIPTALIASSTYLE
  992.           $SMSCRIPTVALIDSTYLES $SMSCRIPTHELPFONDSIZE $SMSCRIPTAPPFONDSIZE
  993.           $SMSCRIPTSYSFONDSIZE $SMSCRIPTSMALLFONDSIZE $SMSCRIPTPREFFONDSIZE
  994.           $SMSCRIPTMONOFONDSIZE $SMSCRIPTNAME $SMSCRIPTFILE $SMSCRIPTCREATOR
  995.           $SMSCRIPTTRAP $SMSCRIPTPRINT $SMSCRIPTICON $SMSCRIPTKEYS
  996.           $SMSCRIPTNUMDATE $SMSCRIPTLANG $SMSCRIPTENCODING $SMSCRIPTTOKEN
  997.           $SMSCRIPTFLAGS $SMSCRIPTSORT $SMSCRIPTDATE $SMSCRIPTNUMBER
  998.           $SMSCRIPTBUNDLE $SMSCRIPTAPPFOND $SMSCRIPTSYSFOND $SMSCRIPTREDRAW
  999.           $SMSCRIPTJUST $SMSCRIPTRIGHT $SMSCRIPTENABLED $SMSCRIPTMUNGED
  1000.           $SMSCRIPTVERSION $SMKEYDISABLESTATE $SMREGIONCODE $SMKCHRCACHE
  1001.           $SMDOUBLEBYTE $SMCHARPORTION $SMOVERRIDE $SMGENFLAGS $SMKEYSWAP
  1002.           $SMKEYCACHE $SMSYSREF $SMKEYSCRIPT $SMLASTSCRIPT $SMSYSSCRIPT
  1003.           $SMPRINT $SMDEFAULT $SMFORCED $SMINTLFORCE $SMFONTFORCE $SMBIDIRECT
  1004.           $SMENABLED $SMMUNGED $SMVERSION $SMREDRAWLINE $SMREDRAWWORD
  1005.           $SMREDRAWCHAR $SMBADSCRIPT $SMBADVERB $SMNOTINSTALLED
  1006.           $SMMASKBOPOMOFO2 $SMMASKJAMO2 $SMMASKHANGUL2 $SMMASKGANA2
  1007.           $SMMASKKANA2 $SMMASKKANA1 $SMMASKASCII2 $SMMASKASCII1 $SMMASKNATIVE
  1008.           $SMMASKASCII $SMMASKALL $SMTRANSPRELOWERCASING
  1009.           $SMTRANSPREDOUBLEBYTING $SMTRANSHANGULFORMAT $SMTRANSRULEBASEFORMAT
  1010.           $SMTRANSUPPER $SMTRANSLOWER $SMTRANSBOPOMOFO2 $SMTRANSJAMO2
  1011.           $SMTRANSHANGUL2 $SMTRANSGANA2 $SMTRANSKANA2 $SMTRANSKANA1
  1012.           $SMTRANSASCII2 $SMTRANSASCII1 $SMTRANSSYSTEM $SMTRANSCASE
  1013.           $SMTRANSNATIVE $SMTRANSASCII $SMCHAR2BYTE $SMCHAR1BYTE $SMCHARUPPER
  1014.           $SMCHARLOWER $SMCHARRIGHT $SMCHARLEFT $SMCHARVERTICAL
  1015.           $SMCHARHORIZONTAL $SMJAMOBOGMOEUM $SMJAMOMOEUM $SMJAMOBOGJAEUM
  1016.           $SMJAMOJAEUM $SMFISCLASSUSER $SMFISCLASSLVL2 $SMFISCLASSLVL1
  1017.           $SMIDEOGRAPHICUSER $SMIDEOGRAPHICLEVEL2 $SMIDEOGRAPHICLEVEL1
  1018.           $SMKANASOFTOK $SMKANAHARDOK $SMKANASMALL $SMPUNCTGRAPHIC
  1019.           $SMPUNCTREPEAT $SMPUNCTBLANK $SMPUNCTSYMBOL $SMPUNCTNUMBER
  1020.           $SMPUNCTNORMAL $SMCHARFISRUSSIAN $SMCHARFISGREEK $SMCHARFISIDEO
  1021.           $SMCHARFISGANA $SMCHARFISKANA $SMCHARBOPOMOFO $SMCHARJAMO
  1022.           $SMCHARHANGUL $SMCHARNONCONTEXTUALLR $SMCHARCONTEXTUALLR
  1023.           $SMCHARBIDIRECT $SMCHARTWOBYTERUSSIAN $SMCHARTWOBYTEGREEK
  1024.           $SMCHARIDEOGRAPHIC $SMCHARHIRAGANA $SMCHARKATAKANA $SMCHAREXTASCII
  1025.           $SMCHAREURO $SMCHARASCII $SMCHARPUNCT $SMCDOUBLEMASK $SMCUPPERMASK
  1026.           $SMCRIGHTMASK $SMCORIENTATIONMASK $SMCCLASSMASK $SMCRESERVED
  1027.           $SMCTYPEMASK $SMMIDDLEBYTE $SMLASTBYTE $SMFIRSTBYTE $SMSINGLEBYTE
  1028.           $INTOUTPUTMASK $INTEUROPEAN $INTJAPANESE $INTROMAN $INTARABIC
  1029.           $INTWESTERN $CALPERSIAN $CALCOPTIC $CALJEWISH $CALJAPANESE
  1030.           $CALARABICLUNAR $CALARABICCIVIL $CALGREGORIAN $VERINDIA
  1031.           $VERYUGOSLAVIA $VERARABIA $VERBELGIUMLUX $MAXCOUNTRY $MINCOUNTRY
  1032.           $VERTHAILAND $VERTAIWAN $VERCHINA $VERKOREA $VERIRELAND $VERRUSSIA
  1033.           $VERIRAN $VERFAEROEISL $VERLAPLAND $VERLATVIA $VERESTONIA $VERHUNGARY
  1034.           $VERPOLAND $VERLITHUANIA $VERPAKISTAN $VERINDIAHINDI $VERYUGOCROATIAN
  1035.           $VERTURKEY $VERCYPRUS $VERMALTA $VERICELAND $VERGREECE $VERGRSWISS
  1036.           $VERFRSWISS $VERFINLAND $VERARABIC $VERAUSTRALIA $VERJAPAN $VERISRAEL
  1037.           $VERNORWAY $VERFRCANADA $VERPORTUGAL $VERDENMARK $VERSPAIN $VERSWEDEN
  1038.           $VERFRBELGIUMLUX $VERNETHERLANDS $VERITALY $VERGERMANY $VERBRITAIN
  1039.           $VERFRANCE $VERUS $LANGCHINESE $LANGYUGOSLAVIAN $LANGMALTA
  1040.           $LANGPORTUGESE $LANGSUNDANESEROM $LANGJAVANESEROM $LANGDZONGKHA
  1041.           $LANGUIGHUR $LANGTATAR $LANGAYMARA $LANGGUARANI $LANGQUECHUA
  1042.           $LANGLATIN $LANGCATALAN $LANGBASQUE $LANGWELSH $LANGESPERANTO
  1043.           $LANGMALAGASY $LANGCHEWA $LANGRUNDI $LANGRUANDA $LANGSWAHILI
  1044.           $LANGSOMALI $LANGOROMO $LANGGALLA $LANGTIGRINYA $LANGAMHARIC
  1045.           $LANGMALAYARABIC $LANGMALAYROMAN $LANGTAGALOG $LANGINDONESIAN
  1046.           $LANGVIETNAMESE $LANGLAO $LANGKHMER $LANGBURMESE $LANGSINHALESE
  1047.           $LANGTELUGU $LANGTAMIL $LANGKANNADA $LANGMALAYALAM $LANGORIYA
  1048.           $LANGPUNJABI $LANGGUJARATI $LANGASSAMESE $LANGBENGALI $LANGMARATHI
  1049.           $LANGSANSKRIT $LANGNEPALI $LANGTIBETAN $LANGSINDHI $LANGKASHMIRI
  1050.           $LANGKURDISH $LANGPASHTO $LANGMONGOLIANCYR $LANGMONGOLIAN
  1051.           $LANGTURKMEN $LANGTAJIKI $LANGKIRGHIZ $LANGMOLDAVIAN $LANGGEORGIAN
  1052.           $LANGARMENIAN $LANGAZERBAIJANAR $LANGAZERBAIJANI $LANGKAZAKH
  1053.           $LANGUZBEK $LANGBYELORUSSIAN $LANGUKRAINIAN $LANGBULGARIAN
  1054.           $LANGMACEDONIAN $LANGSERBIAN $LANGYIDDISH $LANGSLOVENIAN $LANGSLOVAK
  1055.           $LANGCZECH $LANGROMANIAN $LANGALBANIAN $LANGIRISH $LANGFLEMISH
  1056.           $LANGSIMPCHINESE $LANGRUSSIAN $LANGPERSIAN $LANGFARSI $LANGFAEROESE
  1057.           $LANGLAPPISH $LANGLAPPONIAN $LANGLATVIAN $LANGLETTISH $LANGESTONIAN
  1058.           $LANGHUNGARIAN $LANGPOLISH $LANGLITHUANIAN $LANGKOREAN $LANGTHAI
  1059.           $LANGHINDI $LANGURDU $LANGTRADCHINESE $LANGCROATIAN $LANGTURKISH
  1060.           $LANGMALTESE $LANGICELANDIC $LANGGREEK $LANGFINNISH $LANGARABIC
  1061.           $LANGJAPANESE $LANGHEBREW $LANGNORWEGIAN $LANGPORTUGUESE $LANGDANISH
  1062.           $LANGSPANISH $LANGSWEDISH $LANGDUTCH $LANGITALIAN $LANGGERMAN
  1063.           $LANGFRENCH $LANGENGLISH $SMSINDHI $SMSLAVIC $SMAMHARIC $SMRUSSIAN
  1064.           $SMCHINESE $SMKLINGON $SMUNINTERP $SMEXTARABIC $SMVIETNAMESE
  1065.           $SMEASTEURROMAN $SMETHIOPIC $SMGEEZ $SMMONGOLIAN $SMTIBETAN
  1066.           $SMSIMPCHINESE $SMARMENIAN $SMGEORGIAN $SMLAOTIAN $SMTHAI $SMKHMER
  1067.           $SMBURMESE $SMSINHALESE $SMMALAYALAM $SMKANNADA $SMTELUGU $SMTAMIL
  1068.           $SMBENGALI $SMORIYA $SMGUJARATI $SMGURMUKHI $SMDEVANAGARI $SMRSYMBOL
  1069.           $SMCYRILLIC $SMGREEK $SMHEBREW $SMARABIC $SMKOREAN $SMTRADCHINESE
  1070.           $SMJAPANESE $SMROMAN $SMALLSCRIPTS $SMCURRENTSCRIPT $SMSYSTEMSCRIPT))
  1071. (provide-interface 'new script)